#include<iostream>
using namespace std;
typedef long long LL;
const int N = 2e6;
LL s[N];
int m;
int main()
{
	cin >> m;
	for (int i = 1; i <= m; i++) {
		s[i] = s[i - 1] + i;
	}
	for (int i = 1; i <= m ; i++) {
		int l = i - 1;
		int r = m + 1;
		while (l + 1 < r) {
			int mid = l + r >> 1;
			if (s[mid] - s[i - 1] <= m)l = mid;
			else r = mid;
		}
		if (s[l] - s[i - 1] == m) {
			if (i == l)continue;
			cout << i << " " << l << endl;
		}
	}
	return 0;
}